package zhr.chapter8;

class Calc8_5 {
    public static <T extends Number> double sum(T[] a) {
        double sum = 0;
        for (T n : a) {
            sum += n.doubleValue();
        }
        return sum;
    }

    public static <T extends Number> double average(T[] b) {
        double sum = 0;
        for (T n : b) {
            sum += n.doubleValue();
        }
        return sum / b.length;
    }
}
